import java.util.*;

public class Craps {
	private static int[] roll()
	{
		int [] dice = new int[2];
		Random numGen = new Random();
		dice[0] = numGen.nextInt(6) + 1;
		dice[1] = numGen.nextInt(6) + 1;
		
		return dice;
	}
	
	private static void lose(int value)
	{
		System.out.println("You rolled a " + value + ". You lost. Keep rolling.");
	}
	
	public static void main(String[] args)
	{
		int i, j;
		int [] dice = new int[2];
		int value;
		int point;
		
		dice = roll();
		value = dice[0] + dice[1];
		
		switch(value)
		{
		case 2:
			lose(value);
			break;
		case 3:
			lose(value);
			break;
		case 4:
			break;
		case 5:
			break;
		case 6:
			break;
		case 7:
			break;
		case 8:
			break;
		case 9:
			break;
		case 10:
			break;
		case 11:
			break;
		case 12:
			lose(value);
			break;
		default:
			break;
		}
		point = value;
		System.out.println("You rolled: " + value + ". That is your point. Rolling again");
		
		dice = roll();		
		value = dice[0] + dice[1];
		
		while (true)
		{
			if (value == point)
			{
				System.out.println("You win!");
				break;
			}
			else if(value == 7)
			{
				System.out.println("You rolled 7. You lose.");
				break;
			}
			else
			{
				System.out.println("Next roll (P=" + point + ") - D1: " + dice[0] + " D2: " + dice[1] + " Total: " + value);
				dice = roll();
				value = dice[0] + dice[1];
			}
		}
	}
}
